home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / kiss-0.11 / kiss-0 / kiss / src / dohistory.c < prev    next >
C/C++ Source or Header  |  1995-03-23  |  427b  |  24 lines

  1. #include "kiss.h"
  2.  
  3. int dohistory (Stringstack s)
  4. {
  5.     register int
  6.     i,
  7.     j;
  8.     
  9.     if (s.nstr > 2)
  10.     return (warning ("history command takes one optional argument"));
  11.  
  12.     for (i = 0; i < nhislist; i++)
  13.     if (s.nstr == 1 ||
  14.         ! strncmp (s.str [1], hislist [i].str [0], strlen (s.str [1]))
  15.        )
  16.     {
  17.         for (j = 0; j < hislist [i].nstr; j++)
  18.         printf (" %s", hislist [i].str [j]);
  19.         putchar ('\n');
  20.     }
  21.  
  22.     return (0);
  23. }
  24.